<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<style type="text/css">
#online{padding-top:0 !important;}
#online li img{vertical-align:middle;max-width:100%;max-height:106px;position:absolute;top:50%;transform:translate(-50%,-50%);left:50%;z-index:1;}
.saveBtn{display:inline-block;*display:inline;*zoom:1;margin-left:10px;padding:0 18px;height:40px;line-height:40px;cursor:pointer;text-align:center;background:#fff;border:1px solid #CFCFCF;border-radius:3px;color:#565656;font-size:14px;}
.tabs li:hover{color:#fff;background:#00B7EE;border-color:transparent;}
.nonepic{text-align:center;color:#888;margin-top:60px;}
.heading{clear:both;margin:20px 10px;}
.heading h2{color:#333333;font-size:15px;margin:0px;margin-bottom:10px;font-weight:normal;}
.heading hr{border:none;position:relative;margin:0px;height:1px;width:100%;background:#e5e5e5;}
.heading hr:before{height:2px;background:#666666;content:"";position:absolute;top:-1px;width:60px;left:0px;}
</style>
<link href="{__PUBLIC_PATH}/admin/assets/module/Ueditor/dialogs/image/image.css?v={$version}" rel="stylesheet" type="text/css">
</head>
<body>
    <div class="ui-layout-west area manage-area" id="manage_area">
        <div id="tree" class="ztree"></div>
    </div>
    <div class="ui-layout-center" id="online">
        <ul id="list" class="tabs">
            {notempty name="$common_pic"}
                <div class="heading">
                  <h2>最近使用</h2>
                  <hr>
                </div>
                {volist name="common_pic" id="pic"}
                    <li data-url="{$pic.pic_path}" onclick='hover_new(this);'>
                        <img src="{$pic.pic_path}" />
                        <span class="icon"></span>
                    </li>
                {/volist}
            {/notempty}
            <div class="heading">
                 <h2>目录图片</h2>
                 <hr>
            </div>
            {empty name="$list"}
                <div class='nonepic'>暂无图片可选择~</div>
            {else/}
                {volist name="list" id="vo"}
                    <li data-url="{$vo.path}" onclick='hover_new(this);'>
                        <img src="{$vo.path}"  />
                        <span class="icon"></span>
                    </li>
                {/volist}
            {/empty}
        </ul>
    </div>
    <script type="text/javascript" src="{__PUBLIC_PATH}/common/js/jquery.min.js"></script>
    <script type="text/javascript" src="{__PUBLIC_PATH}/common/plugins/layer-v3.1.0/layer.js"></script>
    <script type="text/javascript">
        // 记录选择的图片
        function hover_new(this_) {
            var num = '{$info.num}';
            if (1 == num) {
                // 当数量为1时，仅可选择一张图片
                $("#list li").each(function(){
                    $(this).removeClass("selected")
                });
            }
            // 给点击的图片加上Class
            $(this_).toggleClass("selected");
        }
    </script>
</body>
</html>